﻿using System;
using System.Collections.Generic;

using System.Windows;
using System.Windows.Controls;

using System.Windows.Input;

namespace EagleJournal.Controls
{
    [TemplatePart(Name="PART_Clear", Type=typeof(Button))]
    public class ListNotifInfo : ListBoxItem
    {
        Button clearButton;

        public override void OnApplyTemplate()
        {
            base.OnApplyTemplate();

            clearButton = (Button)Template.FindName("PART_Clear", this);
            clearButton.Click += new RoutedEventHandler(clearButton_Click);
        }

        void clearButton_Click(object sender, RoutedEventArgs e)
        {
            ((ListBox)this.Parent).Items.Remove(this);
        }
    }
}
